package com.controller;

import com.service.TestProviderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("test")
public class TestController {

    @Autowired
    private TestProviderService testService;

    @RequestMapping("hello")
    public String hello(){
        return testService.hello();
    }

    @RequestMapping("ribbon")
    public String ribbon(){

        /* 调用provider10次 */
        for (int i = 1; i <= 10; i++){
            String msg = testService.ribbon(i);
            System.out.println(msg);
        }

        return "测试完毕!";
    }
}
